package net.aiion.weave.impl.bytecode;

import java.util.Collection;

import net.aiion.weave.spi.bytecode.BytecodeContext;
import net.aiion.weave.spi.bytecode.BytecodeSink;
import net.aiion.weave.spi.bytecode.events.BytecodeEvent;

public class BytecodeCollectionWriterSinkImpl implements BytecodeSink
{
    private final Collection<BytecodeEvent> bytecodeEvents;

    public BytecodeCollectionWriterSinkImpl(final Collection<BytecodeEvent> aBytecodeEvents) {
        bytecodeEvents = aBytecodeEvents;
    }

    @Override
    public void handleBytecodeEvent(final BytecodeContext aBytecodeContext) {
        bytecodeEvents.add(aBytecodeContext.getBytecodeEvent());
    }
}
